#ifndef __CMD_LS_H__
#define __CMD_LS_H__
#include "cmd_handle.h" 

#define SZ_NAME 64
#define SZ_PERMISSION 10
#define SZ_TIME 64
#define SZ_LINK_CONTENT 128
#define SZ_PATH 256

typedef struct{
	char f_type;//文件类型
	char f_uname[SZ_NAME];
	char f_gname[SZ_NAME];
	char f_mtime[SZ_TIME];
	char f_permission[SZ_PERMISSION];
	char f_name[SZ_NAME];
	char f_link_content[SZ_LINK_CONTENT];
	struct stat f_stat;
}file_attribute_t;
int operate_ls(command_t*);
int cmd_list_directory(char*);
void make_path(char* path,char*);
int get_file_attr(file_attribute_t*,char*,struct dirent*);
int getchar_file_type(file_attribute_t* );
void show_file_attribute(file_attribute_t*);
int get_file_permission(file_attribute_t*);
void get_file_uname(file_attribute_t*);
void get_file_gname(file_attribute_t*);
void get_file_last_modify_time(file_attribute_t* file);
#endif

